import vine, { SimpleMessagesProvider } from '@vinejs/vine'
import { CustomCamelCaseNamingStrategy } from '#common/camel_case_naming_strategy'
import { BaseModel } from '@adonisjs/lucid/orm'

vine.messagesProvider = new SimpleMessagesProvider({
  // 适用于所有字段
  'required': '必须填写{{ field }}字段',
  'string': '{{ field }}字段的值必须是字符串',
  'email': '无效的电子邮件地址',

  // 针对用户名字段的错误消息
  'username.required': '请为您的账户选择一个用户名',
})

BaseModel.namingStrategy = new CustomCamelCaseNamingStrategy()
